﻿<UserControl 
    x:Class="IndexMarkSilverlightClient.Views.Controls.ReportsControls.USTUTreeView2"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"             
    xmlns:common="clr-namespace:System.Windows;assembly=System.Windows.Controls"
    xmlns:converters="clr-namespace:IndexMarkSilverlightClient.Classes.Converters">
    
    <UserControl.Resources>
        <converters:RespDepToImageConverter x:Key="RespDepToImageConverter"/>
    </UserControl.Resources>
    
    <Grid x:Name="LayoutRoot">
        <controls:TreeView x:Name="USTUTree" ItemsSource="{Binding}" VirtualizingStackPanel.VirtualizationMode="Recycling" Background="Transparent" BorderBrush="Transparent" BorderThickness="0" Height="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto">
            <controls:TreeView.ItemTemplate>
                <common:HierarchicalDataTemplate ItemsSource="{Binding Children}">
                    <StackPanel Orientation = "Horizontal">
                        <Image Source="{Binding Path=Content.TypeObject, Converter={StaticResource RespDepToImageConverter}}" Width="20" Height="20"/>
                        <CheckBox Checked="CheckBox_Click" Unchecked="CheckBox_Click" IsChecked="{Binding IsChecked, Mode=TwoWay}" Content="{Binding Content}" />
                    </StackPanel>
                </common:HierarchicalDataTemplate>
            </controls:TreeView.ItemTemplate>
        </controls:TreeView>
    </Grid>
</UserControl>
